package com.adcc.swingui.demo.toolbar;

import java.awt.Container;

import javax.swing.AbstractButton;
import javax.swing.ImageIcon;
import javax.swing.JComponent;

import com.adcc.swingui.base.DefaultToolBar;

/**
 * 限制区
 * 
 * @author charlie
 * 
 */
public class RaToolBut extends DefaultToolBar {

	private AbstractButton but;

	public RaToolBut(Container container) {
		super(container);
	}

	@Override
	protected JComponent build() {
		but = createButton(new ImageIcon("res/images/ra.png"));
		but.setToolTipText("限制区");
		return but;
	}

	@Override
	protected void addMouseListener() {
		// 这里填写对应响应事件
		but = (AbstractButton) sourceComp;
		// 状态设置（业务填写）
		if (but.isSelected()) {
			but.setSelected(false);
		} else {
			but.setSelected(true);
		}
	}

	@Override
	protected void i18n() {
		// TODO Auto-generated method stub

	}
}
